package org.example.server.controller;


import lombok.extern.slf4j.Slf4j;
import org.example.common.result.Result;
import org.example.dto.HospitalNoDTO;
import org.example.server.service.DepartmentService;

import org.example.vo.DepartmentVO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@RestController
@RequestMapping("/api/v1/dept/")
public class DepartmentController {

    @Resource
    private DepartmentService departmentService;


    @PostMapping("list")
    private Result<List<DepartmentVO>> select(@RequestBody HospitalNoDTO hospitalNo) {

        String hospitalNo1 = hospitalNo.getHospitalNo();
        List<DepartmentVO> departmentVOList = departmentService.select(hospitalNo1);

        return Result.success(departmentVOList);

    }



}
